def run(params:list[str]):
    from modelscope.pipelines import pipeline
    from modelscope.utils.constant import Tasks
    #import cv2
    import sys
    from ApiBase import apiBase

    # # pip install paddleocr
    # from paddleocr import PaddleOCR
    # ocr = PaddleOCR(use_angle_cls=True, lang='ch')  # 初始化PaddleOCR对象
    # img_path = apiBase.argv(1,"/data/llmdata/txt/ocr_recognition.jpg")
    # result = ocr.ocr(img_path, cls=True)  # 进行文字识别
    # for line in result:  # 输出识别结果
    #     print(line)

    try:
        ocr_recognition = pipeline(Tasks.ocr_recognition, model='damo/cv_convnextTiny_ocr-recognition-general_damo')

        ### 使用url
        # img_url = '/data/bzmwork/softrobot/llm/codeqwen-7b/txt/ocr_recognition.jpg'
        img_url = apiBase.argv(1,"/data/llmdata/txt/ocr_recognition.jpg")
        result = ocr_recognition(img_url)
        print(result)

        ### 使用图像文件
        ### 请准备好名为'ocr_recognition.jpg'的图像文件
        # img_path = 'ocr_recognition.jpg'
        # img = cv2.imread(img_path)
        # result = ocr_recognition(img)
        # print(result)
    finally:    
        apiBase.close()